<template>
  <div class="cardBox" :style="{ backgroundColor: boxContent?.bgColor }">
    <div>
      <p>{{ boxContent?.title || '' }}</p>
      <p>{{ boxContent?.number || '' }}</p>
    </div>
    <div>
      <el-icon>
        <component :is="boxContent?.icon" /> 
      </el-icon>
    </div>
  </div>
</template>

<script lang="ts" setup>
defineOptions({ name: 'packageCard' });
import {defineProps,toRefs} from "vue";
const props = defineProps({
  boxContent:{
    type:Object
  }
})
const {boxContent} = toRefs(props)
// const boxContent = {
//   type: 'blue',
//   title: '本月新增设备',
//   number: '9000',
//   icon: 'Setting',
//   bgColor:'lightgreen'
// };
</script>

<style lang="scss" scoped>
.cardBox {
  // width: fit-content;
  border-radius: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 15px;
  background: lightblue;

  div:first-child {
    color: #fff;
    line-height: 24px;
    font-size: 14px;
    margin-right: 20px;

    p:last-child {
      font-size: 20px;
      margin-top: 5px;
    }
  }

  div:last-child {
    background: #fff;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 45px;
    font-size: 20px;
  }
}
</style>
